<%@ page import="java.util.List" pageEncoding="utf-8" contentType="text/html; charset=UTF-8" %>
<%@ page import="staticFactory.a1.Student" %>
<%@ page import="org.springframework.context.ApplicationContext" %>
<%@ page import="org.springframework.context.support.ClassPathXmlApplicationContext" %>
<%@ page import="staticFactory.a1.StudentDaoImpl" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
<body>
    <% ApplicationContext ac=new ClassPathXmlApplicationContext("applicationContext.xml");
       StudentDaoImpl dao=(ac.getBean("studentDao",StudentDaoImpl.class));
       List<Student> stus=dao.findAllStudents();
    %>
    <table border="2">
        <tr> <td>账号</td>  <td>密码</td> </tr>
        <% for(Student stu: stus){ %>
            <tr>
                <td><%=stu.getStuName() %></td>  <td><%=stu.getStuPwd() %></td>
            </tr>
        <% }  %>
    </table>
</body>
</html>
